import { gridOptions, tableToolbar } from "@/config";
export default {
  data() {
    return {
      tableData: [],
      gridOptions,
      tableToolbar,
      tableHeight: 300,//表格默认高度
      filterModel: {},//搜索模型
      formModel: {},//表单模型
      formRules: {},//数据校验规则
      isNew: false,
      isEdit: false,
      pageRequest: {
        page: 1,
        pageSize: 50
      },
      page: {
        total: null, // 总条数
        sizes: [100, 200, 300, 500]
      },

    };
  },
  mounted() {
    /**
     * 监听窗口大小设置表格高度
     */
    this.$nextTick(function () {
      if (this.$refs.vxeTable != undefined) {
        this.tableHeight =
          window.innerHeight -
          this.$refs.vxeTable.$el.getBoundingClientRect().top -
          80;
        var that = this;
        window.onresize = function () {
          that.tableHeight =
            window.innerHeight -
            that.$refs.vxeTable.$el.getBoundingClientRect().top -
            80;
        };
      }
    });
  },
  async created() {
    // console.log(1,this.path);
  },

  methods: {
        // 点第几页
        async currentChangeHandle(val) {
          this.pageRequest.page = val;
          await this.fetchData();
        },


  }
};
